package router

import (
	platformController "gitee.com/wangshh_123/cross-pay-go/src/controller/platform"
	"gitee.com/wangshh_123/cross-pay-go/src/middleware"
	"github.com/gin-gonic/gin"
)

// SetupCardDetailRouter 设置统一的卡片详情路由
func SetupCardDetailRouter(api *gin.RouterGroup) {
	// 创建统一的卡详情控制器实例
	cardDetailController := platformController.NewCardDetailController()

	// 卡详情路由组
	cardDetail := api.Group("/card-detail")
	{
		// 基础卡详情查询 - 根据用户平台自动选择
		cardDetail.GET("/", middleware.AuthMiddleware(), middleware.PlatformInfoMiddleware(), cardDetailController.GetCardDetail)

		// 指定平台卡详情查询 - 管理员功能
		cardDetail.GET("/platform/:platform", middleware.AuthMiddleware(), cardDetailController.GetCardDetailByPlatform)

		// 获取支持卡详情查询的平台列表
		cardDetail.GET("/platforms", cardDetailController.GetSupportedPlatforms)
	}
}
